Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #18642 - user/selfedit policy does not work without at least one content/edit and content/create policy #125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emodric
Copy link
Collaborator

@emodric emodric commented Sep 28, 2011

This is a fix for issue #18642 at http://issues.ez.no/IssueView.php?Id=18642&activeItem=1

Since user/selfedit is not in the content module, access to self editing is denied early in the index.php, because existing access function expression when self editing is only "(edit or create)". And when both of those are missing from policy list, user cannot edit himself.

I propose moving selfedit function from user module to content module which will allow for access function expression to be "(edit or create or selfedit)" thus allowing the module to run, and later relying on ($obj->canEdit()) to return a valid value based on match of current user ID and object ID to be edited.

If you think this is a welcome change, another pull request needs to be added to ezflow so new installs can create content/selfedit policies instead of user/selfedit.

@emodric
Copy link
Collaborator Author

emodric commented Sep 28, 2011

And ofcourse, the following SQL is needed when upgrading:

UPDATE ezpolicy SET module_name = 'content' WHERE module_name = 'user' AND function_name = 'selfedit';

@andrerom
Copy link
Contributor

-1 from me, we intend to move user out of content at some point, so then this move would just cause more work.

@gggeek
Copy link
Contributor

gggeek commented Sep 29, 2011

(Without looking at the code) I would also prefer to keep user editing outside of content, and trying to fix it (the fact that content/edit is required for user/selfedit) some other way

@emodric
Copy link
Collaborator Author

emodric commented Sep 30, 2011

The only way I see is in eZUser->hasAccessToView method around eval() function call. It would be a dirty hack, for example, if module is "content" and view is "edit" then if eval() call returns false and user has access to user/selfedit, set it to true.

peterkeung pushed a commit to peterkeung/ezpublish that referenced this pull request Dec 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants